Me.Cls
Me.Print strName
Me.Print Left$(strName, 4)
Me.Print Left$(strName, 7)
End Sub
The Left$() functions first parameter is the string you wish to retrieve the leftmost characters from. The 2nd parameter is how many of those characters you want to retrieve.
Right$( )
Right$() returns the rightmost number of characters specified in a string. Heres an example:
Private Sub cmdRight_Click ()
Dim strName As String
strName = "Bill Gates"
Me.Cls
Me.Print strName
Me.Print Right$(strName, 7)
Me.Print Right$(strName, 10)
End Sub
The Right$() functions first parameter is the string you wish to retrieve the rightmost characters from. The 2nd parameter is how many of those characters you want to retrieve.
Mid$( )
Mid$() returns a substring of a specified number of characters within a string. Heres an example:
Private Sub cmdMid_Click ()
Dim strName As String
strName = "Bill Gates"
Me.Cls
Me.Print strName
Me.Print Mid$(strName, 1, 4)
Me.Print Mid$(strName, 6, 2)
End Sub